function printCoord(pt: { x: number, y: number }) {
  console.log('坐标的x的值为：' + pt.x)
  console.log('坐标的y的值为：' + pt.y)
}

printCoord({
  x: 3,
  y: 7
})

function printName(obj: { first: string, last?: string }) {
  console.log(obj.last?.toUpperCase())
}

printName({
  first: 'string'
})

printName({
  first: 'string',
  last: undefined
})